<template>
	<view class="container">
		<view class="righttopbox" :style="{top:$isIos()?'10upx':'100upx'}">
			<uni-icons type="home-filled" color="rgba(0, 0, 0, 0.6)" size="22"  @click="back"></uni-icons>
			<text class="zhong">|</text>
			<uni-icons type="circle-filled" color="rgba(0, 0, 0, 0.6)" size="23"  @click="backs"></uni-icons>
		</view>
		<iframe class="webview" :style="{height:$isIos()?'94vh':'100vh'}" :src="data.url" v-if="data.url"></iframe>
		<!-- <web-view class="webview" :src="data.url" v-if="data.url"></web-view> -->

	</view>
</template>

<script setup>
	import {ref,reactive,getCurrentInstance} from "vue";
	import {onLoad,onShow,onPullDownRefresh,onReachBottom} from "@dcloudio/uni-app";
	const { appContext } = getCurrentInstance();
	const data = reactive({
		url:''
	})
	onLoad((option)=>{
		data.url=uni.getStorageSync('applet')
	})
	onShow(()=>{
	})
	onPullDownRefresh(()=> {
			setTimeout(function () {
				uni.stopPullDownRefresh();
			}, 1000);
		})
	onReachBottom(()=>{
		console.log('onReachBottom')
	})

	function backs(){
		uni.switchTab({
			url:'/pages/index/index'
		})
	}
	function back(){
		let url=data.url
		data.url=''
		setTimeout(()=>{
			data.url=url
		},100)
		
	}

</script>

<style lang="scss" scoped>
	.container{
		// padding: 30upx;
		.webview{
			width: 100vw;
			height: 95vh;
			z-index: -1;
			border: none;
			padding: 0;
			margin: 0;
		}
		.righttopbox{
			display: flex;
			align-items: center;
			position: fixed;
			right: 30upx;
			z-index: 99999;
			border: 1upx solid #eee;
			border-radius: 40upx;
			font-size: 28upx;
			padding: 5upx 20upx;
			background-color: rgba(255, 255, 255, 0.5);
			.zhong{
				margin: 0 10upx;
				color: #eee;
			}
		}
	}
</style>
<style>
	page{
		background-color: #fff;
	}
</style>
